package com.hamster.crmpre.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hamster.crmpre.mapper.ManagerPerformanceMapper;
import com.hamster.crmpre.pojo.ManagerPerformance;
import com.hamster.crmpre.service.ManagerPerformanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Lizhipeng
 * @date ：Created in 2020/1/6 11:09
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class ManagerPerformanceServiceImpl implements ManagerPerformanceService {

    @Autowired
    private ManagerPerformanceMapper managerPerformanceMapper;

    /**
     * 根据登录者id获取经理业绩
     * @param userId
     * @return
     */
    @Override
    public List<ManagerPerformance> list(String userId) {
        QueryWrapper<ManagerPerformance> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("employee_id",userId).orderByDesc("create_time");
        return managerPerformanceMapper.selectList(queryWrapper);
    }
}
